package com.atguigu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: gulimall
 * @description: TODO
 * @author: YuWenYi
 * @create: 2021-07-13 20:57
 **/
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    //用了这个之后,login.html等页面就不需要自己去写个controller去映射了!
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //将一个请求映射给一个页面,注意,只能支持get请求,别的请求会报错!!!
        //registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");

    }
}
